import { Component } from 'react'
import { Modal } from 'antd'
import AddProductForm from './AddProductForm'

export default class AddProduct extends Component {
  render () {
    // destroyOnClose 保证窗口关闭时, 表单内容被清空
    return (
      <Modal
        visible={this.props.visible}
        title="添加商品"
        footer={null}
        onCancel={this.props.onCancel}
        destroyOnClose
        width="700px"
      >
        <AddProductForm
          close={this.props.onCancel}
          getTableData={this.props.getTableData}
        />
      </Modal>
    )
  }  
}
